﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;



using System.ServiceModel;
using BPM.ClientLink.pws;
using BPM.ClientLink.wfs;
namespace BPM.Base.WFLib
{
	public class pws
	{
        static PowerServiceClient pwClient;
        private pws()
        {
                BasicHttpBinding binding = new BasicHttpBinding();
                EndpointAddress endAddress = new EndpointAddress("http://localhost:7654/PWDB/PW/");

                pwClient = new PowerServiceClient(binding, endAddress);
        }

       public  static PowerServiceClient getPWS()
        {
            if(pwClient==null )
            {
                new pws();
            }

            return pwClient;
        }
	}


    public class wfs
    {
        static WorkflowServiceClient   wfClient;
        private wfs()
        {
            BasicHttpBinding binding = new BasicHttpBinding();
            EndpointAddress endAddress = new EndpointAddress("http://localhost:7655/WFDB/WF/");

            wfClient = new WorkflowServiceClient(binding, endAddress);
        }

        public static WorkflowServiceClient getWFS()
        {
            if (wfClient == null)
            {
                new wfs();
            }

            return wfClient;
        }
    }
}
